<?php
use com\junziqian\sdk\util\Assert;
use com\junziqian\sdk\util\CommonUtil;
use com\junziqian\sdk\util\RequestUtils;

/**
 * 企业信息人脸校验并上传
 * User: huhu
 * @edit yfx 2019-10-30
 */
//引入composer的入口函数,参考composer的使用规范
require_once __DIR__ . '/../../../../vendor/autoload.php';
//定义初始化变量，这些变量在生产中请设为全局变量或通用变量
$serviceUrl="http://sandbox.api.junziqian.com";
$appkey="xxxxxxxx";
$appSecret="xxxxxxxxxxxxxxx";
//构建请求工具
$requestUtils=new RequestUtils($serviceUrl, $appkey, $appSecret);

//初始化合同参数
$request=array(
    "orderNo" => "NO000000000XXXXX1", //TODO *
    "enterpriseName" => "重XXXXX公司", //TODO *
    "identityNo" => "500XXXXXXXXXXXX", //TODO *
    "legalPersonName" => "文XX", //TODO *
    "legalIdentityCard" => "500XXXXXXXXXXXX", //TODO *
    "legalMobile" => "153XXXXXXXX", //TODO *
    "facePerType" => 1, //TODO *
    "faceAgantIdenName" => "易XX", //TODO *
    "faceAgantIdenCard" => "500XXXXXXXXXXXX", //TODO *
    "backUrl" => "http://xxx.xxx.xxx", //TODO *
);

//发起请求
$response=$requestUtils->doPost("/v2/user/organizationFaceCreate",$request);
//处理结果
print_r(CommonUtil::json_encode($response));
Assert::notNull($response,"返回的结果不能为空");
Assert::isTrue($response->success,"处理错误:".CommonUtil::json_encode($response));